import { NgModule } from '@angular/core';
import {RouterModule, Routes} from '@angular/router';
import {CartComponent} from './cart/cart.component';
import {PageNotFoundComponent} from './page-not-found/page-not-found.component';
import {HomeComponent} from './home/home.component';
import {OrderComponent} from './order/order.component';
import {AuthGuard} from './auth/auth-guard.service';
import {GoodsDetailComponent} from './goods-detail/goods-detail.component';
import {MiaoshaComponent} from "./miaosha/miaosha.component";

const appRouter: Routes = [
  {path: '', component: HomeComponent},
  {path: 'cart', component: CartComponent},
  {path: 'order', canActivate: [AuthGuard], component: OrderComponent},
  {path: 'goods-detail', component: GoodsDetailComponent},
  {path: 'goods-detail/:id', component: GoodsDetailComponent},
  {path: 'miaosha', component: MiaoshaComponent}
  // {path: 'not-found', component: PageNotFoundComponent },
  // {path: '**', redirectTo: '/not-found'}
];
@NgModule ({
  imports: [RouterModule.forRoot(appRouter)],
  exports: [RouterModule]
})
export class AppRoutingModule {}
